@echo off
chcp 65001 >nul
echo ========================================
echo    海康威视相机物体识别系统启动器
echo ========================================
echo.

echo 正在检查Python环境...
python --version >nul 2>&1
if errorlevel 1 (
    echo 错误: 未找到Python环境，请先安装Python 3.7+
    pause
    exit /b 1
)

echo Python环境检查通过
echo.

echo 正在检查并安装必要的依赖包...

echo 安装PyQt5...
pip install PyQt5 -i https://pypi.tuna.tsinghua.edu.cn/simple/

echo 安装OpenCV...
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple/

echo 安装NumPy...
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/

echo 安装Ultralytics (YOLO)...
pip install ultralytics -i https://pypi.tuna.tsinghua.edu.cn/simple/

echo 安装PaddleOCR...
pip install paddleocr -i https://pypi.tuna.tsinghua.edu.cn/simple/

echo.
echo 依赖安装完成！
echo.

echo 正在启动物体识别系统...
echo 请确保相机已连接并正常工作
echo.

cd /d "%~dp0BasicDemo"
python object_recognition_demo.py

echo.
echo 程序已退出
pause 